package com.feng.spring5.test;

import com.feng.spring5.bean.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class bean1 {

    @Test
    public void test1(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean1.xml");
        User u = applicationContext.getBean("User",User.class);
        //User u = applicationContext.getBean(User.class);//和上面一行的效果一样
        System.out.printf(u.toString());
    }
}
